import { request } from '@/utils/request'
//获取所有分类
export function getALLCategory (parentId) {
  return request({
    url: '/api/category/list?parentId=' + parentId,
    method: 'get'
  })
}

//添加分类
export function addCategory (params) {
  return request({
    url: '/api/category/add',
    method: 'post',
    data: params
  })
}

//更新分类
export function updateCategory (params) {
  return request({
    url: '/api/category/update',
    method: 'put',
    data: params
  })
}

//删除分类
export function deleteCategory (categoryId) {
  return request({
    url: '/api/category/delete?categoryId=' + categoryId,
    method: 'delete'
  })
}


